<template>
  <div>
    <h1>{{userid}}</h1>
<h1>功能</h1>
    <ul v-for="i in data" :key="i">
      <li><router-link :to="{path:i.url}">{{i.name}}</router-link></li>
    </ul>
  </div>

</template>

<script>
import axios from 'axios';
export default {
  name: "xiaogongneng"
  ,
  data() {
    return {
    userid:localStorage.getItem('userid'),
      id:1,
      data:'',
    }
  },
  methods: {
    getdata(){
     axios({url:'http://127.0.0.1:5000/getgongneng',method:'get',params:{id:this.id}}).then(res=>{
       console.log(res)
       this.data=res.data.list
     })
    },
  },
  mounted() {
    this.getdata()
  }
}
</script>

<style scoped>

</style>